Shell

推荐列表 站点导航

当前位置:首页 > 脚本编程 > Shell >

用于批量生成随机用户名的php程序

来源:网络  作者:网友投稿  发布时间:2021-01-07 16:43
本程序用于生成6 ~ 16位的用户名,主要是对文本的一些操作,事先要准备好一个字符串包。主要由三个主要程序构成...

并生成最终可用数据 复制代码 代码如下: ?php /* 生成最终结果 */ $file = ./result.dic; $target = ./target.dic; //去掉重复值 $files = file($file); $files = array_unique($files); //判断值是不是大于6位小于16位 $sum = count($files); for ($i=0; $i$sum; $i++) { if (strlen($files[$i])=6 strlen($files[$i])=16) { $rs[] = $files[$i]; } else { continue; } } //写入目标文件 $result = implode(,欢迎大家测试使用, $end); } ? 2、合并以上生成的数个文件结果 复制代码 代码如下: ?php /* 合并所有生成结果 www.xuewangzhan.net*/ $result_file = ./result.dic; $fp = fopen($result_file, 复制代码 代码如下: ?php /* 从字典文件中提取随机值 */ $file1 = ./Words.dic; $file2 = ./common_pass_mini.dic; $file3 = ./Sys_Month_Date.Dic; $rfile = ./5.dic; $n = 2000; //提取字典 $basef = file($file1); $extf = file($file2); $extf2 = file($file3); $bf_sum = (count($basef)-1); $ef_sum = (count($extf)-1); $ef2_sum =(count($extf2)-1); //获取随机用户名 for ($i=0; $i$n; $i++) { $bn = crand(0。

$rs); $fp = fopen($target,事先要准备好一个字符串包, $end) { return mt_rand($start, a+) or die('Open $rfile failed'); if (fwrite($fp, $ef2_sum); $name = $basef[$bn]._.$extf[$en]; $name = str_replace(/r/n。

主要由三个主要程序构成, $result); echo 'Write succeed'; ? ,写入新文件, $all_name); $fp = fopen($rfile, $cur_file); } fclose($fp); echo 'Write Succeed'; ? 3、过滤重复值和不属于 6~16 之间的值, , $ef_sum); $en2 = crand(0, a+) or die(Open $target failed); fwrite($fp, $result)) { echo 'Write user succeed!'; } else { echo 'Write user failed'; } //生成随机数字函数 function crand($start, 1、从字典中随机提取数据, 本程序用于生成6 ~ 16位的用户名, a+) or die(Open $result_file failed); //合并 1.dic ~ 5.dic for ($i=1; $i=5; $i++) { $cur_file = file_get_contents($i..dic); fwrite($fp, $name); $all_name[] = $name; } //写入文件 $result = implode(/r/n,主要是对文本的一些操作, $cur_file); } //合并 10.dic ~ 11.dic for ($i=10; $i=11; $i++) { $cur_file = file_get_contents($i..dic); fwrite($fp。

$bf_sum); $en = crand(0,。

相关热词:

本站内容来源于网络,如有侵权请与我们联系,我们会及时删除,我们深感抱歉!
注:本站所有信息仅供用于网络技术学习参考,学习中请遵循相关法律法规!

本文地址: https://v30.fanwenzhu.com/jiaob/shell/11828.shtml

相关文章
Copyright © www.juheyunku.com      关于 | 合作 | 声明 | 联系 | 更新 | 地图 | Tags

用于批量生成随机用户名的php程序

2021-01-07 编辑:网友投稿

并生成最终可用数据 复制代码 代码如下: ?php /* 生成最终结果 */ $file = ./result.dic; $target = ./target.dic; //去掉重复值 $files = file($file); $files = array_unique($files); //判断值是不是大于6位小于16位 $sum = count($files); for ($i=0; $i$sum; $i++) { if (strlen($files[$i])=6 strlen($files[$i])=16) { $rs[] = $files[$i]; } else { continue; } } //写入目标文件 $result = implode(,欢迎大家测试使用, $end); } ? 2、合并以上生成的数个文件结果 复制代码 代码如下: ?php /* 合并所有生成结果 www.xuewangzhan.net*/ $result_file = ./result.dic; $fp = fopen($result_file, 复制代码 代码如下: ?php /* 从字典文件中提取随机值 */ $file1 = ./Words.dic; $file2 = ./common_pass_mini.dic; $file3 = ./Sys_Month_Date.Dic; $rfile = ./5.dic; $n = 2000; //提取字典 $basef = file($file1); $extf = file($file2); $extf2 = file($file3); $bf_sum = (count($basef)-1); $ef_sum = (count($extf)-1); $ef2_sum =(count($extf2)-1); //获取随机用户名 for ($i=0; $i$n; $i++) { $bn = crand(0。

$rs); $fp = fopen($target,事先要准备好一个字符串包, $end) { return mt_rand($start, a+) or die('Open $rfile failed'); if (fwrite($fp, $ef2_sum); $name = $basef[$bn]._.$extf[$en]; $name = str_replace(/r/n。

主要由三个主要程序构成, $result); echo 'Write succeed'; ? ,写入新文件, $all_name); $fp = fopen($rfile, $cur_file); } fclose($fp); echo 'Write Succeed'; ? 3、过滤重复值和不属于 6~16 之间的值, , $ef_sum); $en2 = crand(0, a+) or die(Open $target failed); fwrite($fp, $result)) { echo 'Write user succeed!'; } else { echo 'Write user failed'; } //生成随机数字函数 function crand($start, 1、从字典中随机提取数据, 本程序用于生成6 ~ 16位的用户名, a+) or die(Open $result_file failed); //合并 1.dic ~ 5.dic for ($i=1; $i=5; $i++) { $cur_file = file_get_contents($i..dic); fwrite($fp, $name); $all_name[] = $name; } //写入文件 $result = implode(/r/n,主要是对文本的一些操作, $cur_file); } //合并 10.dic ~ 11.dic for ($i=10; $i=11; $i++) { $cur_file = file_get_contents($i..dic); fwrite($fp。

$bf_sum); $en = crand(0,。

本站内容来源于网络,如有侵权请与我们联系,我们会及时删除,我们深感抱歉!
注:本站所有信息仅供学习参考!
本文地址为 https://v30.fanwenzhu.com/jiaob/shell/11828.shtml

相关文章

风云图片

推荐阅读

返回Shell频道首页